package cn.fl.system.controller;

import cmm.comm.facade.framework.api.ISysDictionaryApiService;
import cmm.mid.core.framework.page.KeyValueVO;
import cmm.web.core.framework.controller.BaseController;
import cn.fl.capital.constant.CapitalConstant;
import cn.fl.framework.base.context.CurrentThreadContext;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Description: 民族查询下拉列表
 * @Author: Fuzq
 * @Date: 10:30 2020-02-23
 * @Version V1.0
 */

@RestController
@RequestMapping(value = "/system/nation")
public class SysNationMapController extends BaseController {

    @Autowired
    private ISysDictionaryApiService sysDictionaryApiService;

    @RequestMapping(value = "/list.do", method = RequestMethod.POST)
    public Object getNationMap() {
        JSONObject jsonObject = new JSONObject();
        List<KeyValueVO> keyValueVOS = sysDictionaryApiService.getKvList("CST0060", "30000", "0000");
        for (KeyValueVO keyValueVO : keyValueVOS) {
            keyValueVO.setValue(keyValueVO.getValue().trim());
        }
        jsonObject.put("list", keyValueVOS);
        return jsonObject;
    }
}
